extern crate scfg;
extern crate serde_json;

use self::scfg::{cmd::doit, sql::Sql, LockFile, SvCache};
use self::serde_json::Value;
use lazy_static::lazy_static;
use tokio::sync::RwLock;

lazy_static! {
    static ref READ_LOCK: LockFile = RwLock::new(false);
    static ref CACHE: SvCache = SvCache::new(200);
}

#[allow(dead_code)]
pub async fn dourl(data: Value, model: &str, cmd: &str) -> Result<Value, Value> {
    doit(data, model, cmd, &READ_LOCK, CACHE.clone()).await
}
